/*
 * Admin.java
 *
 * This program is designed to demonstrate the use of classes Doctor and Patient
 * defined in the same package.
 *
 * 
 */

package com.javacore.day6.hospital;

/**
 * This class is used to simulate the functions of an Administrator in 
 * an hospital. It assigns a doctor to a patient using the classes 
 * Doctor and Patient.
 *
 * @author 
 */
public class Admin {
    
    /** Creates a new instance of Admin */
    public Admin() {
    }
    
    /**
     * This is the entry point of the application.
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        // Create a new Doctor
        Doctor objDoctor = new Doctor();
        
        // Accept details about the doctor
        objDoctor.setDoctorInfo();
        
        // Create a new Patient
        Patient objPatient = new Patient();
        
        // Accept patient details
        objPatient.setPatientDetails();
        
        // Assign a doctor to a patient
        objPatient.doctorCode = objDoctor.code;
        objPatient.doctorName = objDoctor.name;
        System.out.format("The doctor for %s is %s.", objPatient.name, objDoctor.name);
        System.out.println();
        
        // Display the patient and doctor details
        objPatient.getPatientDetails();
        objDoctor.getDoctorInfo();
    }
}
